package cn.lsc.service.impl;

import cn.lsc.domain.CourseChapter;
import cn.lsc.mapper.CourseChapterMapper;
import cn.lsc.result.JSONResult;
import cn.lsc.service.ICourseChapterService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 课程章节 ， 一个课程，多个章节，一个章节，多个视频 服务实现类
 * </p>
 *
 * @author lsc
 * @since 2022-09-02
 */
@Service
public class CourseChapterServiceImpl extends ServiceImpl<CourseChapterMapper, CourseChapter> implements ICourseChapterService {
    @Autowired
    private CourseChapterMapper courseChapterMapper;

    @Override
    public List<CourseChapter> listByCourseId(Long courseId) {
        Wrapper<CourseChapter> CourseChapter = new EntityWrapper<>();
        CourseChapter.eq("course_id", courseId);
        return selectList(CourseChapter);
    }
}
